package lion.framework.core.web.path;

import java.util.ArrayList;
import java.util.List;

import lion.dev.lang.InterceptorAdaptor;
import lion.framework.core.web.anno.ExecuteInterceptorSpec;

/**
 * Execute Interceptor 管理类
 * 
 * @author lion
 * @email hl_0074@sina.com
 * @date 2015年4月18日
 */
public class ExecutorInterceptorManager {

	private static List<ExecuteInterceptorSpec> interceptorSpecs = new ArrayList<>();

	public static void registe(ExecuteInterceptorSpec spec) {

		interceptorSpecs.add(spec);
	}

	public static List<InterceptorAdaptor> getInterceptors() {

		List<InterceptorAdaptor> result = new ArrayList<>();
		for (ExecuteInterceptorSpec spec : interceptorSpecs) {
			result.add(spec.getAdapter());
		}

		return result;
	}
}
